//------------------------------------------------------------------------------
// <copyright file="Utils.h" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//------------------------------------------------------------------------------

#pragma once

#include <memory>
#include <string>
namespace Microsoft { namespace Internal { namespace GamesTest { namespace Rpc { namespace Server { namespace Encoding { namespace Base64
{
	// We used this class based on the answer here: https://forums.xboxlive.com/AnswerPage.aspx?qid=83c3a8b6-122a-439a-8365-2d938a18022c&tgt=1
	// This class was retrieved from the InGameStore XDK sample. It was modified to reduce any excess copying of arrays or strings.
	class Utils
	{
	public:
		static std::shared_ptr<unsigned __int8> Base64StringToBuffer(const wchar_t* string, unsigned int stringLength, unsigned int& outBufferLength);		
		static std::wstring BufferToBase64String(const unsigned __int8* buffer, unsigned int bufferLength);
	};


	
}}}}}}}